package command;

import lombok.extern.slf4j.Slf4j;

import java.util.ArrayList;
import java.util.List;

/**
 * @author zenghy
 **/
@Slf4j
public class Broke {

    private List<Order> orderList = new ArrayList<>();

    public Broke takeOrder(Order order) {
        orderList.add(order);
        return this;
    }

    public void placeOrders() {
        orderList.forEach(Order::execute);
        orderList.clear();
    }
}
